<%@page import="service.SellerService"%>
<%@page import="entities.SellerEntity"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String sellerName = (String) session.getAttribute("sellerName");
	String password = (String) session.getAttribute("sellerpassword");
	SellerEntity seller = new SellerEntity();
	if (sellerName == null || password == null) {
		response.sendRedirect("_seller/");
	} else {
		seller = SellerService.confirm(sellerName, password.trim());
	}
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title></title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" type="text/css"
	href="<%=basePath%>css/GlobalSet.css">

<style type="text/css">
* {
	margin: 0;
	padding: 0;
	list-style-type: none;
}

a,img {
	border: 0;
}

a,a:visited {
	color: #5e5e5e;
	text-decoration: none;
}

a:hover {
	color: #333;
}

body {
	color: #333;
	background: #fafafa;
}
/* navbox */
.navbox,.nav li,.nav li.current a,.nav li.selected a span,.nav li a.selected,.nav li a.selected span
	{
	background: url(images/headerbg.png) no-repeat;
}

.navbox {
	height: 39px;
	background-position: 0 -138px;
	background-repeat: repeat-x;
	position: relative;
	z-index: 9;
}

.nav {
	width: 960px;
	margin: 0 auto;
}

.nav li {
	float: left;
	height: 39px;
	background-position: 100% -99px;
	padding: 0 3px 0 2px;
	position: relative;
}

.nav li.last {
	background: none;
}

.nav li a {
	float: left;
	display: block;
	padding: 0 0 0 4px;
	height: 39px;
	overflow: hidden;
}

.nav li a span {
	float: left;
	display: block;
	padding: 0 4px 0 0;
	line-height: 39px;
	font-size: 14px;
	color: #fff;
	font-weight: 800;
	cursor: pointer;
	width: 142px;
	text-align: center;
}

.nav li.selected a,.nav li a.selected {
	background-position: 0 -60px;
	text-decoration: none;
}

.nav li.selected a span,.nav li a.selected span {
	background-position: 100% -60px;
	color: #ff7e00;
}

.nav li.selected .submenu {
	display: block;
}

.nav li .submenu {
	display: none;
	position: absolute;
	top: 39px;
	left: 6px;
}

.nav li .submenu {
	border-style: solid;
	border-width: 0px 1px 1px 1px;
	border-color: #ddd;
	padding: 0 5px 5px 5px;
	width: 132px;
	background: #fff;
}

.nav li .submenu {
	-moz-border-radius: 0 0 3px 3px;
	-webkit-border-radius: 0 0 3px 3px;
	border-radius: 0 0 3px 3px;
	-moz-box-shadow: 0 5px 5px #D3D3D3;
	-webkit-box-shadow: 0 5px 5px #D3D3D3;
	box-shadow: 0 5px 5px #D3D3D3;
}

.nav li .submenu li {
	float: none;
	padding: 0;
	background: none;
	height: auto;
	border-bottom: dotted 1px #BEBEBE;
}

.nav li .submenu li.last {
	border: none;
}

.nav li .submenu li a {
	float: none;
	padding: 0;
	text-align: center;
	height: 28px;
	line-height: 28px;
	background: none;
}

.nav li .submenu li a:hover {
	background: #ddd;
	font-weight: 800;
}
/*商家信息*/
.sellerInfo {
	width: 960px;
	height: 180px;
	background: #FAFAFA;
	margin: auto;
	height: 120px;
	padding-top: 6px;
	background: #FAFAFA;
}

p.sellerName {
	font-size: 250%;
	margin: 10px;
	color: #6E155F;
}

p.orderPhone {
	font-size: 24px;
	margin-bottom: 20px;
	padding: 2px 0px;
	padding-left: 32px;
	color: Red;
}

.info1 {
	width: 480px;
	float: left;
}

.info1 img {
	box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.5) !important;
}

.logo {
	float: left;
	margin-right: 15px;
	width: 200px;
	height: 100px;
}

.info2 {
	width: 220px;
	float: left;
	margin-right: 20px;
}

.info2 span {
	font-size: 13px;
	color: #BEBEBE;
}
</style>

<script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
<script type="text/javascript">
	function dropMenu(obj) {
		$(obj).each(function() {
			var theSpan = $(this);
			var theMenu = theSpan.find(".submenu");
			var tarHeight = theMenu.height();
			theMenu.css({
				height : 0,
				opacity : 0
			});
			theSpan.hover(function() {
				$(this).addClass("selected");
				theMenu.stop().show().animate({
					height : tarHeight,
					opacity : 1
				}, 400);
			}, function() {
				$(this).removeClass("selected");
				theMenu.stop().animate({
					height : 0,
					opacity : 0
				}, 400, function() {
					$(this).css({
						display : "none"
					});
				});
			});
		});
	}

	$(document).ready(function() {

		dropMenu(".drop-menu-effect");

	});
</script>

</head>


<body>
	<div style="background: #FAFAFA;">
		<div class="sellerInfo">
			<div class="info1">
				<img class="logo" alt="<%=seller.getName()%>"
					title="<%=seller.getName()%>" src="<%=seller.getLogoURL()%>" />
				<p class="sellerName"><%=seller.getName()%></p>
				<p class="orderPhone"><%=seller.getTel()%></p>
			</div>
			<div class="info2">
				<p>
					地址：<span><%=seller.getAddress()%></span><br /> 送餐时间：<span
						style="color:red;font-size: 13px;"><%=seller.getDeliverTime()%></span>
				</p>
			</div>
			<div class="info2">
				<p>
					简介：<span><%=seller.getDesc()%></span>
				</p>
			</div>
			<span  style="display:block;width:50px;height:20px;margin-top:30px;float:right;"><a href="<%=basePath %>servlet/SellerLogoutServlet">退出</a></span>
		</div>
	</div>
	<div class="navbox">
		<div class="nav">
			<ul class="clearfix">
				<li><a class="selected" href="_seller/"><span>首页</span> </a>
				</li>
				<li  class="drop-menu-effect"><a href="_seller/ordermanage.jsp?choice=all"><span>订单管理</span>
				</a>
					<ul class="submenu">
						<li><a href="_seller/ordermanage.jsp?choice=all">所有订单</a></li>
						<li><a href="_seller/ordermanage.jsp?choice=ungive">未发货订单</a></li>
						<li><a href="_seller/ordermanage.jsp?choice=give">已发货订单</a></li>
					</ul></li>
				<li class="drop-menu-effect"><a target="_blank" href="_seller/menuManage.jsp?action=online"><span>菜单管理</span>
				</a>
				<ul class="submenu"> 
					<li ><a href="_seller/menuManage.jsp?action=online">销售中的菜肴</a>
					</li>
					<li><a
						href="_seller/menuManage.jsp?action=offline">已下架的菜肴</a>
					</li>
					<li ><a href="_seller/menuManage.jsp?action=add&type=goods">添加菜肴</a>
					</li>
					<li><a
						href="_seller/menuManage.jsp?action=tuangou">团购菜单管理</a>
					</li>
				</ul>
				</li>
					<%
						SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
						String date = sdf1.format(new Date());
					 %>
				<li class="drop-menu-effect"><a target="_blank" href="_seller/sellerdealmessage.jsp?date=<%=date %>"><span>交易信息统计</span>
				</a>
					</li>
				<li class="drop-menu-effect"><a target="_blank" href="_seller/commentManage.jsp"><span>评论查看</span>
				</a>
					</li>
				<li class="drop-menu-effect"><a target="_blank" href="_seller/sellerInfo.jsp?action=info"><span>我的信息管理</span>
				</a>
					<ul class="submenu">
						<li><a href="_seller/sellerInfo.jsp?action=logo">Logo修改</a></li>
						<li><a href="_seller/sellerInfo.jsp?action=phone">电话修改</a></li>
						<li><a href="_seller/sellerInfo.jsp?action=password">密码修改</a></li>
						<li><a href="_seller/sellerInfo.jsp?action=info">基本信息管理</a></li>
					</ul>
				</li>

			</ul>
		</div>
	</div>

</body>
</html>